<template>
	<view :style="themeColor">
		<view class="page">
			<view
				class="flex benben-position-layout flex flex-wrap align-center newAttention_flex_0"
				:style="{height:(88+StatusBarRpx)+'rpx',paddingTop:StatusBarRpx+'rpx', }"
			>
				<view class='flex flex-wrap align-center justify-between flex-sub newAttention_fd0_0'>
					<view
						class='flex flex-wrap align-center justify-center newAttention_fd0_0_c0'
						@tap.stop="handleJumpDiy"
						data-type="back"
						data-url="1"
					>
						<text class='fu-iconfont2  newAttention_fd0_0_c0_c0'>&#xE794;</text>
					</view>
					<view class='flex flex-wrap align-stretch justify-center'>
						<text
							class='newAttention_fd0_0_c1_c0'
							style="font-family: Alimama DongFangDaKai, Alimama DongFangDaKai;"
						>新增关注</text>
					</view>
					<view class='flex flex-wrap align-center newAttention_fd0_0_c0'>
					</view>
				</view>

			</view>
			<view :style="{height: (88+StatusBarRpx)+'rpx'}"></view>
			<view
				class="loading_css"
				v-if="isShow"
			>
				<u-loading
					size="36"
					color="#AD3823"
				></u-loading>
				<view>加载中</view>
			</view>

			<!---flex布局flex布局开始-->
			<view
				class="flex flex-direction align-stretch benben-flex-layout newAttention_flex_1"
				v-else
			>
				<template v-for='(item,key0) in list'>
					<view
						class='flex align-center newAttention_fd1_0'
						:key='key0'
					>
						<image
							class='newAttention_fd1_0_c0'
							mode="aspectFill"
							:src='item.head_img'
							@tap.stop="handleJumpDiy"
							data-type="navigateTo"
							:data-url="`/pages/othersPage/othersPage/othersPage?user_id=${item.from_user_id}`"
						></image>
						<view class='flex flex-direction align-stretch flex-sub'>
							<text class='newAttention_fd1_0_c1_c0' style="font-family: Source Han Sans CN, Source Han Sans CN;">{{item.user_nickname}}</text>
							<view class='flex flex-wrap align-center newAttention_fd1_0_c1_c1'>
								<view class='flex flex-wrap align-center' style="font-family: Source Han Sans CN, Source Han Sans CN;">
									<text>{{item.brief}}</text>
									<text style="margin-left: 24rpx;">{{item.create_time}}</text>
								</view>
								<!-- <text class='newAttention_fd1_0_c1_c1_c1'>{{item.grass_num}}</text> -->
							</view>
						</view>
						<!-- <button class='newAttention_fd1_0_c2' @tap.stop="cnacelGuanzhuFunc(item.id)" v-if=" item.is_fans_follow_self=='1'">已关注</button> -->
						<button
						style="font-family: Alimama DongFangDaKai, Alimama DongFangDaKai;"
							class='newAttention_fd1_0_c2_1'
							@tap.stop="getFollow(item.from_user_id)"
							v-if="item.is_fans_follow_self=='1' && item.is_self_follow_fans=='0'"
						>关注</button>
						<button
						style="font-family: Alimama DongFangDaKai, Alimama DongFangDaKai;"
							class='newAttention_fd1_0_c2_2'
							@tap.stop="getFollow(item.from_user_id)"
							v-if="item.is_fans_follow_self=='1' && item.is_self_follow_fans=='1'"
						>互相关注</button>
					</view>
				</template>
				<view
					class="loadmore"
					v-if="last_page > 1"
				>
					<u-loadmore
						font-size="24"
						:status="status"
						:icon-type="iconType"
						:load-text="loadText"
					/>
				</view>
			</view>

			<!---平台消息flex布局结束-->
			<view
				class="noData"
				v-if="list.length == 0 && !isShow"
			>
				<image :src='STATIC_URL+"no.png"'></image>
			</view>

		</view>
	</view>
</template>
<script>
	import {
		validate
	} from '@/common/utils/validate.js'
	export default {
		components: {},

		data() {
			return {
				"list": [],
				"page": 1,
				"is_pull": true,
				"last_page": 1,
				"status": 'loadmore',
				"iconType": 'flower',
				"loadText": {
					loadmore: '轻轻上拉',
					loading: '努力加载中',
					nomore: '我也是有底线的'
				},
				"isShow": true,
			};
		},
		computed: {
			themeColor() {
				return this.$store.getters.themeColor
			},

		},
		watch: {},
		onLoad(options) {
			this.getList();
		},
		onUnload() {

		},
		onReady() {

		},
		onShow() {

		},
		onHide() {

		},
		onResize() {

		},
		// 下拉刷新
		onPullDownRefresh() {
			this.page = 1;
			this.is_pull = true;
			this.isShow = true;
			this.getList();
		},
		// 上拉加载
		onReachBottom() {
			if (this.page >= this.last_page) return;
			this.status = 'loading';
			this.page++;
			setTimeout(() => {

				if (this.page >= this.last_page) this.status = 'nomore';
				else this.status = 'loading';
				this.is_pull = false;
				this.getList();
			}, 500)
		},
		onPageScroll(e) {

		},
		methods: {
			getList() {
				this.$api.post(global.API_VERSION + '655317bf96506', {
					page: this.page,
				}).then(res => {
					// console.log(res);
					uni.stopPullDownRefresh();
					this.isShow = false;
					if (res.data.code == 1) {
						this.last_page = res.data.data.last_page;
						if (this.is_pull) {
							this.list = res.data.data.data;
						} else {
							this.list = this.list.concat(res.data.data.data);
						}
					} else {
						this.$message.info(res.data.msg);
					}
				})
			},
			getFollow(id) {
				this.$api.post(global.API_VERSION + '6552cbf5eac8e', {
					user_id: id
				}).then(res => {
					this.$message.info(res.data.msg);
					if (res.data.code == 1) {
						this.page = 1;
						this.is_pull = true;
						// this.isShow = true;
						this.getList();
					}
				})
			},
		}
	};
</script>
<style
	lang="scss"
	scoped
>
	.page {
		width: 100vw;
		overflow-x: hidden;
		min-height: calc(100vh - var(--window-bottom));
		background: url(https://www.guochaoxiaoju.com/uploads/mini/571.png) no-repeat;
		background-size: 100% auto;
	}

	.newAttention_flex_0 {
		background: url(https://www.guochaoxiaoju.com/uploads/mini/571.png) no-repeat;
		width: 750rpx;
		height: 88rpx;
		overflow: hidden;
		z-index: 10;
		top: 0rpx;
		background-size: 100% auto !important;
	}

	.newAttention_fd0_0_c1_c0 {
		font-size: 40rpx;
		font-weight: 400;
		color: #000000;
		line-height: 88rpx;
	}

	.newAttention_fd0_0_c0_c0 {
		font-size: 36rpx;
		color: #333;
	}

	.newAttention_fd0_0_c0 {
		width: 50rpx;
		height: 50rpx;
	}

	.newAttention_fd0_0 {
		padding: 0rpx 32rpx 0rpx 32rpx;
	}

	.newAttention_flex_1 {
		padding: 0rpx 30rpx 0rpx 30rpx;
	}

	.newAttention_fd1_0_c2_2 {
		border: 1px solid #62889B;
		background: #F8F8F8;
		border-radius: 32rpx 32rpx 32rpx 32rpx;
		width: 172rpx;
		line-height: 64rpx;
		font-size: 32rpx;
		color: rgba(98, 136, 155, 1);
		height: 64rpx;
	}

	.newAttention_fd1_0_c2_1 {
		border: 1px solid #AD3823;
		background: var(--benbenbgColor2);
		border-radius: 32rpx 32rpx 32rpx 32rpx;
		width: 172rpx;
		line-height: 64rpx;
		font-size: 32rpx;
		color: var(--benbenFontColor3);
		height: 64rpx;
	}

	.newAttention_fd1_0_c2 {
		border: 1px solid #AD3823;
		background: #F8F8F8;
		border-radius: 32rpx 32rpx 32rpx 32rpx;
		width: 172rpx;
		line-height: 64rpx;
		font-size: 32rpx;
		color: var(--benbenFontColor4);
		height: 64rpx;
	}

	.newAttention_fd1_0_c1_c1_c1 {
		margin: 0rpx 0rpx 0rpx 10rpx;
	}

	.newAttention_fd1_0_c1_c1 {
		color: #999999;
		font-size: 24rpx;
		line-height: 33rpx;
		font-weight: 400;
	}

	.newAttention_fd1_0_c1_c0 {
		color: #000000;
		font-size: 32rpx;
		font-weight: 500;
		line-height: 40rpx;
		margin: 0rpx 0rpx 16rpx 0rpx;
	}

	.newAttention_fd1_0_c0 {
		width: 108rpx;
		height: 108rpx;
		border-radius: 54rpx;
		margin: 0rpx 23rpx 0rpx 0rpx;
	}

	.newAttention_fd1_0 {
		padding: 32rpx 0rpx 32rpx 0rpx;
	}
</style>